<?php

class Application_Form_FEdytujDane extends Zend_Form {

    public function init() {

        $this->setMethod('post');

        $view = Zend_Layout::getMvcInstance()->getView();
        $url = $view->url(array(
            'controller' => 'klient', 'action' => 'edytuj-dane'
                ));
        $this->setAction($url);

        $password = new Zend_Form_Element_Password('USE_password');
        $password->setRequired('true')
                ->setAttrib('renderPassword', true)
                ->setAttrib('class', 'inputbox')
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->removeDecorator('label')
                ->removeDecorator('HtmlTag');
        $this->addElement($password);

        $imie = new Zend_Form_Element_Text('USE_imie');
        $imie->setRequired('true')
                ->setAttrib('class', 'inputbox')
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->removeDecorator('label')
                ->removeDecorator('HtmlTag');
        $this->addElement($imie);

        $nazwisko = new Zend_Form_Element_Text('USE_nazwisko');
        $nazwisko->setRequired('true')
                ->setAttrib('class', 'inputbox')
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->removeDecorator('label')
                ->removeDecorator('HtmlTag');
        $this->addElement($nazwisko);

        $email = new Zend_Form_Element_Text('USE_email');
        $email->setAttrib('class', 'inputbox')
                ->removeDecorator('label')
                ->removeDecorator('HtmlTag')
                ->addFilters(array('StringTrim', 'StripTags'))
                ->addValidator('EmailAddress', TRUE);
        $this->addElement($email);

        $submit = new Zend_Form_Element_Submit('submit', 'Zapisz Dane');
        $submit->setRequired('true')
                ->setAttrib('class', 'button')
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->removeDecorator('label')
                ->removeDecorator('HtmlTag')
                ->removeDecorator('DtDdWrapper');
        $this->addElement($submit);
    }

}

